reverse each word in a string using c